package com.syiti.dev.example.service.consumer.app.modular.user.convert;

import com.syiti.dev.example.service.consumer.app.modular.user.dao.dataobject.UserDO;
import com.syiti.dev.example.service.consumer.app.modular.user.vo.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.ReportingPolicy;

import java.util.List;

/**
 * 用户
 *
 * @author caiti
 * @since 2021-06-16
 */
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface UserConvert {

	/**
	 * DO转DTO
	 *
	 * @param userDO
	 * @return
	 */
	@Mappings({
		@Mapping(target = "userId", source = "id")
	})
	UserVO doConvertVO(UserDO userDO);

	/**
	 * doList转listVO
	 *
	 * @param userDO
	 * @return
	 */
	List<UserVO> doListConvertListVO(List<UserDO> userDO);

}
